package com.concurrent.chapter1.concurrent08;

import java.util.concurrent.Exchanger;

public class Main {
	public static void main(String[] args) {
		Exchanger<String> exchanger = new Exchanger<>();
		ThreadA a = new ThreadA(exchanger);
		a.setName("A");
		ThreadB b = new ThreadB(exchanger);
		b.setName("B");
		a.start();
		b.start();
		System.out.println("main end");
	}
}
